/*
 * =====================================================================================
 *
 *       Filename:  clock_gettime.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  02/19/2000 06:44:19 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Chen Ken (Ken), zlchen.ken@gmail.com
 *        Company:  EMC
 *
 * =====================================================================================
 */

#include <time.h>
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
	struct timespec ts;
	int res = clock_gettime(CLOCK_MONOTONIC, &ts);
	if(res < 0)
	{
		cout << "clock_gettime error\n";
	}

	cout << ts.tv_sec << "\n" << ts.tv_nsec << "\n";
	
	struct timespec ts2;
	res = clock_gettime(CLOCK_MONOTONIC, &ts2);
	if(res < 0)
	{
		cout << "clock_gettime error\n";
	}

	cout << ts2.tv_sec << "\n" << ts2.tv_nsec << "\n";

	return 0;
}
